package com.ffs.game.scene.stage.input;

import com.badlogic.gdx.Input;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.InputListener;
import com.ffs.game.scene.control.ISkillControl;

/**
 * 技能输入监听
 *
 * @author ffs80
 */
public class SkillInputListener extends InputListener {

    //技能控制器
    private ISkillControl skillControl;

    public SkillInputListener(ISkillControl skillControl) {
        this.skillControl = skillControl;
    }

    @Override
    public boolean keyDown(InputEvent event, int keycode) {
        switch (keycode) {
            //普通技能
            case Input.Keys.Z:
                skillControl.commonSkill();
                break;
            //伤害技能
            case Input.Keys.X:
                skillControl.hurtSkill();
                break;
            //远程技能
            case Input.Keys.C:
                skillControl.remoteSkill();
                break;
            default:
                break;
        }
        return false;
    }

    @Override
    public boolean keyUp(InputEvent event, int keycode) {
        return super.keyUp(event, keycode);
    }
}
